﻿<table class="table table-hover table-striped table-condensed table-bordered ordersTable" data-ng-controller="OrderChildController">
    <thead>
        <tr>
            <th data-ng-click="setOrder('product')">Product</th>
            <th data-ng-click="setOrder('quantity')">Quantity</th>
            <th data-ng-click="setOrder('price')">Unit Price</th>
            <th data-ng-click="setOrder('orderTotal')">Total</th>
        </tr>
    </thead>
    <tbody>
        <tr data-ng-hide="customer.orders || customer.orders.length > 0" class="error">
            <td colspan="4">
                <div class="text-center"><strong>No orders found</strong></div>
            </td>
        </tr>
        <tr data-ng-repeat="order in customer.orders | orderBy:orderby:reverse">
            <td>
                {{ order.product }}
            </td>
            <td>
                {{ order.quantity }}
            </td>
            <td>
                {{ order.price | currency }}
            </td>
            <td>
                {{ order.orderTotal | currency }}
            </td>
        </tr>
        <tr class="info">
            <td colspan="3">
                &nbsp;
            </td>
            <td>
                <strong>{{ ordersTotal | currency }}</strong>
            </td>
        </tr>
    </tbody>
</table>